<?php
class Place_Model_SaleUserRole extends Zend_Db_Table{
    protected $_name  = "sale_user_role";
    protected $_primary = "sale_user_role_id";
    
    public function getRoleOfUser($userId){
        $normalUtils = new My_Utils_NormalUtils();
        $DB = $normalUtils->getNormalDb(1);
        $getUserRole = $DB  ->select()
                            ->from(
                                array('ur' => 'sale_user_role'),
                                array('sale_role_id')
                                )
                            ->where('sale_user_id = ?',$userId);
        $queryResult = $DB->fetchAll($getUserRole);
        $result = $queryResult[0]->sale_role_id;
        return $result;
    }
}
